
package org.jetnuke.dao.sqlserver;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;

import net.jforum.JForumExecutionContext;
import net.jforum.util.preferences.SystemGlobals;

public class SqlServerBannerDAO extends org.jetnuke.dao.generic.GenericBannerDAO {

	public List selectActiveByTypeOffset(int type, int bannum) throws Exception {
		PreparedStatement p;
		String q = SystemGlobals.getSql("BannerModel.selectActiveByTypeOffset");
		q=q.replaceAll("#start",String.valueOf(bannum));
		p = JForumExecutionContext.getConnection().prepareStatement(q);
		p.setInt(1,type);
		p.setInt(2,type);
		
		ResultSet rs = p.executeQuery();
		List list = this.processSelectAll(rs);
		rs.close();
		p.close();
		
		return list;
	}
}
